﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace bt_toado
{
    class toado
    {
          int tungdo, hoanhdo;
        public int TungDo
        {
            set { tungdo = value; }
            get { return tungdo; }
        }
        public int HoanhDo
        {
            set { hoanhdo = value; }
            get { return hoanhdo; }
        }
        public toado(int t,int h)
        {
            tungdo = t;
           hoanhdo = h;
        }

        public toado()
        {
        }
        public void Nhap(ref toado a)
        {
            Console.Write(" moi ban nhap toa do cua tung do : ");
            TungDo = int.Parse(Console.ReadLine());
            Console.Write("moi ban nhap toa do cua hoanh do: ");
            HoanhDo = int.Parse(Console.ReadLine());
        }
        public void Xuat(toado a)
        {
            Console.WriteLine("({0},{1})",TungDo,HoanhDo);
        } 

        public static toado operator +(toado a, toado b)
        {
            toado kq = new toado();
            kq.TungDo = a.TungDo + b.TungDo;
            kq.HoanhDo = a.HoanhDo + b.HoanhDo;
            
            return kq;
        }
        public static toado operator -(toado a, toado b)
        {
            toado kq = new toado();
            kq.TungDo = a.TungDo - b.TungDo;
            kq.HoanhDo = a.HoanhDo - b.HoanhDo;

            return kq;
        }
        public static toado operator *(toado a, toado b)
        {
            toado kq = new toado();
            kq.TungDo = a.TungDo * b.TungDo;
            kq.HoanhDo = a.HoanhDo * b.HoanhDo;

            return kq;
        }

    }
}




    

